Optimal. Leaf size=65 \[ -\frac {2 i (a+i a \tan (c+d x))^{2+n}}{a^2 d (2+n)}+\frac {i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 45}
\begin {gather*} \frac {i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}-\frac {2 i (a+i a \tan (c+d x))^{n+2}}{a^2 d (n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3568
Rubi steps
\begin {align*} \int \sec ^4(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac {i \text {Subst}\left (\int (a-x) (a+x)^{1+n} \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac {i \text {Subst}\left (\int \left (2 a (a+x)^{1+n}-(a+x)^{2+n}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac {2 i (a+i a \tan (c+d x))^{2+n}}{a^2 d (2+n)}+\frac {i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(143\) vs. \(2(65)=130\).
time = 13.76, size = 143, normalized size = 2.20 \begin {gather*} -\frac {i 2^{3+n} e^{4 i (c+d x)} \left (e^{i d x}\right )^n \left (\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^n \left (3+e^{2 i (c+d x)}+n\right ) \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d \left (1+e^{2 i (c+d x)}\right )^3 (2+n) (3+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.54, size = 1668, normalized size = 25.66
method | result | size |
risch | \(\text {Expression too large to display}\) | \(1668\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 142 vs. \(2 (57) = 114\).
time = 0.39, size = 142, normalized size = 2.18 \begin {gather*} -\frac {8 \, {\left ({\left (i \, n + 3 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + i \, e^{\left (6 i \, d x + 6 i \, c\right )}\right )} \left (\frac {2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{d n^{2} + 5 \, d n + {\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, {\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, {\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \sec ^{4}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.44, size = 216, normalized size = 3.32 \begin {gather*} -\frac {4\,{\left (\frac {a\,\left (\cos \left (2\,c+2\,d\,x\right )+1+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,c+2\,d\,x\right )+1}\right )}^n\,\left (n\,3{}\mathrm {i}+\cos \left (2\,c+2\,d\,x\right )\,15{}\mathrm {i}+\cos \left (4\,c+4\,d\,x\right )\,6{}\mathrm {i}+\cos \left (6\,c+6\,d\,x\right )\,1{}\mathrm {i}-9\,\sin \left (2\,c+2\,d\,x\right )-6\,\sin \left (4\,c+4\,d\,x\right )-\sin \left (6\,c+6\,d\,x\right )+n\,\cos \left (2\,c+2\,d\,x\right )\,4{}\mathrm {i}+n\,\cos \left (4\,c+4\,d\,x\right )\,1{}\mathrm {i}-2\,n\,\sin \left (2\,c+2\,d\,x\right )-n\,\sin \left (4\,c+4\,d\,x\right )+10{}\mathrm {i}\right )}{d\,\left (n^2+5\,n+6\right )\,\left (15\,\cos \left (2\,c+2\,d\,x\right )+6\,\cos \left (4\,c+4\,d\,x\right )+\cos \left (6\,c+6\,d\,x\right )+10\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________